package m.jclecai.com.fragment.klpk.pager;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;



import java.util.ArrayList;

import m.jclecai.com.R;
import m.jclecai.com.bean.klpk.bean.PokerBean;
import m.jclecai.com.view.klpk.PagerRecyclerAdapter;
import m.jclecai.com.view.klpk.Poker;

/**
 * Created by andy on 2017/6/6.
 */

public class ThreeSheetsFragment extends BasePagerFragment {



    @Override
    protected ArrayList<ArrayList<PokerBean>> initData() {

        setIndex(4);
        setItemAward(6400);
        setSelectAllAward(500);

        mTvSelectedAllRules.setText(getSelectedAllRichText("任选数字,只要开出豹子即中奖500元"));

        //同样这里我们要实现的就是初始化数据；
        ArrayList<ArrayList<PokerBean>> mListData = new ArrayList<>();
        //这里将13个对子进行一个初始化；
        for (int i=1;i<14;i++){
            ArrayList<PokerBean> pokerBeanList=new ArrayList<>();
            pokerBeanList.add(new PokerBean(PokerBean.Category.box,i));
            pokerBeanList.add(new PokerBean(PokerBean.Category.box,i));
            pokerBeanList.add(new PokerBean(PokerBean.Category.box,i));

            mListData.add(pokerBeanList);
        }
        return mListData;
    }

    @Override
    public PagerRecyclerAdapter getMyAdapter() {
        return new MyAdapter(null);
    }

    @Override
    public RecyclerView.LayoutManager getLayoutManager() {
        return new GridLayoutManager(getActivity(), 4){
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
    }

    public class MyAdapter extends PagerRecyclerAdapter{

        public MyAdapter(ArrayList<ArrayList<PokerBean>> listData) {
            super(listData);
        }

        @Override
        protected int getPokerCategory() {
            return Poker.TYPE_PAIRS;
        }

        @Override
        public int getItemLayout() {
            return R.layout.item_poke_pair;
        }
    }


    @Override
    public String getSelectAllTitle() {
        return "豹子包选";
    }
}
